package com.square.service.forum.provider.action;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.api.R;
import com.square.service.common.annotation.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 18.40
 * @date : 2020/4/4 18:46
 * @description :
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class ForumController {

    /**
     *
     * @param name
     * @return
     */
    @GetMapping("/getName")
    public R getName(String name) {
        System.out.println("您的名字是" + name);
        return R.failed("您的名字是" + name);
    }


    /**
     * 自定义注解操作日志测试
     *
     * @param aPara
     * @param bPara
     * @return
     * @throws Exception
     */
    @Log(name = "asd")
    @GetMapping("testOperateLog")
    public R<?> testOperateLog(String aPara, String bPara) throws Exception {
        log.info("执行testOperateLog======================");
        //  throw new Exception("测试异常");
        System.currentTimeMillis();
        return R.ok(null);
    }

}
